(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
nonZero(0) → false
nonZero(s(x)) → true
p(0) → 0
p(s(x)) → x
id_inc(x) → x
id_inc(x) → s(x)
random(x) → rand(x, 0)
rand(x, y) → if(nonZero(x), x, y)
if(false, x, y) → y
if(true, x, y) → rand(p(x), id_inc(y))
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RANDOM(z0) → c6(RAND(z0, 0))
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
S tuples:
RANDOM(z0) → c6(RAND(z0, 0))
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RANDOM, RAND, IF
Compound Symbols:
c6, c7, c9
(3) CdtGraphRemoveDanglingProof (BOTH BOUNDS(ID, ID) transformation)
Removed 1 of 3 dangling nodes:
RANDOM(z0) → c6(RAND(z0, 0))
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
S tuples:
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1), NONZERO(z0))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)), P(z0), ID_INC(z1))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(5) CdtGraphRemoveTrailingProof (BOTH BOUNDS(ID, ID) transformation)
Removed 3 trailing tuple parts
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
S tuples:
RAND(z0, z1) → c7(IF(nonZero(z0), z0, z1))
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(7) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)
Use narrowing to replace
RAND(
z0,
z1) →
c7(
IF(
nonZero(
z0),
z0,
z1)) by
RAND(0, x1) → c7(IF(false, 0, x1))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(0, x1) → c7(IF(false, 0, x1))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
S tuples:
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(0, x1) → c7(IF(false, 0, x1))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
IF, RAND
Compound Symbols:
c9, c7
(9) CdtGraphRemoveDanglingProof (ComplexityIfPolyImplication transformation)
Removed 1 of 3 dangling nodes:
RAND(0, x1) → c7(IF(false, 0, x1))
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
S tuples:
IF(true, z0, z1) → c9(RAND(p(z0), id_inc(z1)))
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
IF, RAND
Compound Symbols:
c9, c7
(11) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)
Use narrowing to replace
IF(
true,
z0,
z1) →
c9(
RAND(
p(
z0),
id_inc(
z1))) by
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(13) CdtGraphRemoveDanglingProof (ComplexityIfPolyImplication transformation)
Removed 1 of 5 dangling nodes:
IF(true, 0, x1) → c9(RAND(0, id_inc(x1)))
(14) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
K tuples:none
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(15) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
We considered the (Usable) Rules:
id_inc(z0) → z0
id_inc(z0) → s(z0)
p(0) → 0
p(s(z0)) → z0
And the Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(IF(x1, x2, x3)) = x2 + x1·x2
POL(RAND(x1, x2)) = [2]x1
POL(c7(x1)) = x1
POL(c9(x1)) = x1
POL(id_inc(x1)) = 0
POL(p(x1)) = x1
POL(s(x1)) = [2] + x1
POL(true) = [1]
(16) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), z0))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(17) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)
Use narrowing to replace
IF(
true,
x0,
z0) →
c9(
RAND(
p(
x0),
z0)) by
IF(true, 0, x1) → c9(RAND(0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
(18) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, 0, x1) → c9(RAND(0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, 0, x1) → c9(RAND(0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(19) CdtGraphRemoveDanglingProof (ComplexityIfPolyImplication transformation)
Removed 1 of 5 dangling nodes:
IF(true, 0, x1) → c9(RAND(0, x1))
(20) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(21) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
IF(true, s(z0), x1) → c9(RAND(z0, x1))
We considered the (Usable) Rules:
id_inc(z0) → z0
id_inc(z0) → s(z0)
p(0) → 0
p(s(z0)) → z0
And the Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [3]
POL(IF(x1, x2, x3)) = [3]x1 + [2]x2
POL(RAND(x1, x2)) = [2]x1
POL(c7(x1)) = x1
POL(c9(x1)) = x1
POL(id_inc(x1)) = [5] + [2]x1
POL(p(x1)) = x1
POL(s(x1)) = [2] + x1
POL(true) = 0
(22) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, x0, z0) → c9(RAND(p(x0), s(z0)))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(23) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)
Use narrowing to replace
IF(
true,
x0,
z0) →
c9(
RAND(
p(
x0),
s(
z0))) by
IF(true, 0, x1) → c9(RAND(0, s(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
(24) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, 0, x1) → c9(RAND(0, s(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, 0, x1) → c9(RAND(0, s(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(25) CdtGraphRemoveDanglingProof (ComplexityIfPolyImplication transformation)
Removed 1 of 5 dangling nodes:
IF(true, 0, x1) → c9(RAND(0, s(x1)))
(26) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(27) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
We considered the (Usable) Rules:
id_inc(z0) → z0
id_inc(z0) → s(z0)
And the Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(IF(x1, x2, x3)) = [3]x1 + [4]x2
POL(RAND(x1, x2)) = [4]x1
POL(c7(x1)) = x1
POL(c9(x1)) = x1
POL(id_inc(x1)) = [2] + [3]x1
POL(s(x1)) = [2] + x1
POL(true) = 0
(28) Obligation:
Complexity Dependency Tuples Problem
Rules:
nonZero(0) → false
nonZero(s(z0)) → true
p(0) → 0
p(s(z0)) → z0
id_inc(z0) → z0
id_inc(z0) → s(z0)
random(z0) → rand(z0, 0)
rand(z0, z1) → if(nonZero(z0), z0, z1)
if(false, z0, z1) → z1
if(true, z0, z1) → rand(p(z0), id_inc(z1))
Tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
S tuples:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
K tuples:
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
Defined Rule Symbols:
nonZero, p, id_inc, random, rand, if
Defined Pair Symbols:
RAND, IF
Compound Symbols:
c7, c9
(29) CdtKnowledgeProof (EQUIVALENT transformation)
The following tuples could be moved from S to K by knowledge propagation:
RAND(s(z0), x1) → c7(IF(true, s(z0), x1))
IF(true, s(z0), x1) → c9(RAND(z0, id_inc(x1)))
IF(true, s(z0), x1) → c9(RAND(z0, x1))
IF(true, s(z0), x1) → c9(RAND(z0, s(x1)))
Now S is empty
(30) BOUNDS(O(1), O(1))